﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Location.aspx.cs" Inherits="Main_Master_Location"
    EnableEventValidation="false" %>

<%@ Register Src="~/User Controls/PageHeading.ascx" TagName="heading" TagPrefix="acc" %>
<%@ Register Src="~/User Controls/CommonControls.ascx" TagName="CommonControls" TagPrefix="MyControls" %>
<%@ Register Src="~/User Controls/Pager.ascx" TagPrefix="custom" TagName="Pager" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Location </title>
    <link href="../../Styles/accounts.css" rel="Stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <div class="divmain" style="margin-top: 5px; margin-bottom: 15px">
            <acc:heading ID="pagehead" runat="server" HeadingText="Location" />
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <Triggers>
                    <asp:PostBackTrigger ControlID="controls" />
                </Triggers>
                <ContentTemplate>
                    <div style="margin-left: 5%; margin-right: 5%; width: 90%" align="center">
                        <asp:Label ID="lblMsg" runat="server" Font-Bold="true"></asp:Label></div>
                    <asp:UpdateProgress DynamicLayout="false" ID="UpdProgress" runat="server">
                        <ProgressTemplate>
                            <div align="center">
                                <img src="../../Images/ajax-loader.gif" /></div>
                        </ProgressTemplate>
                    </asp:UpdateProgress>
                    <asp:HiddenField ID="HidControl" runat="server" />
                    <asp:Panel ID="PnlAddNew" runat="server" Visible="false">
                        <table class="tablecontent" style="width: 75%; margin-left: 13%; border: 1px solid #818181">
                            <tr>
                                <td colspan="4" class="headtd">
                                    Location Details
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 20%;">
                                    Name&nbsp;<span style="color: Red">*</span>
                                </td>
                                <td colspan="3">
                                    <asp:TextBox ID="TxtDescription" runat="server" CssClass="input"> </asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RFVDescription" runat="server" ControlToValidate="TxtDescription"
                                        ErrorMessage="*"></asp:RequiredFieldValidator>
                                    Active&nbsp;<asp:CheckBox ID="ChkActive" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Parent Location
                                </td>
                                <td colspan="3">
                                    <asp:DropDownList ID="DDLParentLocation" runat="server" CssClass="dropdown">
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="DDLParentLocation"
                                        InitialValue="0" ErrorMessage="!"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Address Line1<span style="color: Red">*</span>
                                </td>
                                <td>
                                    <asp:TextBox ID="TxtAddress1" ToolTip="Enter Address" runat="server" CssClass="input" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TxtAddress1"
                                        ErrorMessage="!"></asp:RequiredFieldValidator>
                                </td>
                                <td>
                                    Address Line2
                                </td>
                                <td>
                                    <asp:TextBox ID="TxtAddress2" ToolTip="Enter Address" runat="server" CssClass="input" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Address Line3
                                </td>
                                <td>
                                    <asp:TextBox ID="TxtAddress3" ToolTip="Enter Address" runat="server" CssClass="input" />
                                </td>
                                <td>
                                    Address Line4
                                </td>
                                <td>
                                    <asp:TextBox ID="TxtAddress4" ToolTip="Enter Address" runat="server" CssClass="input" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Place<span style="color: Red">*</span>
                                </td>
                                <td>
                                    <asp:TextBox ID="TxtCity" runat="server" CssClass="input"> </asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="TxtCity"
                                        ErrorMessage="!"></asp:RequiredFieldValidator>
                                </td>
                                <td>
                                    State<span style="color: Red">*</span>
                                </td>
                                <td>
                                    <asp:DropDownList ID="DDLState" runat="server" CssClass="dropdown">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Country<span style="color: Red">*</span>
                                </td>
                                <td>
                                    <asp:DropDownList ID="DDLCountry" runat="server" ToolTip="Enter Country Name" CssClass="dropdown" />
                                </td>
                                <td>
                                    Pin
                                </td>
                                <td>
                                    <asp:TextBox ID="TxtPin" runat="server" CssClass="input"> </asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Phone
                                </td>
                                <td>
                                    <asp:TextBox ID="TxtPhone" ToolTip="Enter Phone" runat="server" CssClass="input" />
                                </td>
                                <td>
                                    Fax
                                </td>
                                <td>
                                    <asp:TextBox ID="TxtFax" ToolTip="Enter Fax" runat="server" CssClass="input" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Email
                                </td>
                                <td>
                                    <asp:TextBox ID="TxtEmail" ToolTip="Enter Fax" runat="server" CssClass="input" />
                                </td>
                                <td>
                                    Remarks
                                </td>
                                <td>
                                    <asp:TextBox ID="TxtRemarks" MaxLength="150" runat="server" TextMode="MultiLine"> </asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4" align="center">
                                    <asp:Button ID="BtnSave" runat="server" Text="Save" CssClass="button" OnClick="BtnSave_Click" />
                                    &nbsp;
                                    <asp:Button ID="BtnUpdate" runat="server" Text="Update" CssClass="button" OnClick="BtnUpdate_Click" />
                                    &nbsp;<asp:Button ID="BtnClose" runat="server" Text="Close" CssClass="button" OnClick="BtnClose_Click"
                                        ValidationGroup="false" CausesValidation="false" />
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                    <asp:Panel ID="PnlView" runat="server" Visible="false">
                        <div style="margin-left: 10%;">
                            <div style="padding-top: 15px; margin-left: 30%;">
                                <div style="float: left;">
                                    <custom:Pager ID="custPager" runat="server" OnPageChanged="custPager_PageChanged" />
                                </div>
                                <div style="float: left; margin-left: 10px;">
                                    <MyControls:CommonControls ID="controls" runat="server" GridviewControlId="GrdLocation"
                                        HideColumns="5" />
                                </div>
                            </div>
                            <div id="divprint" runat="server">
                                <asp:GridView ID="GrdLocation" Width="95%" runat="server" CssClass="gridview" AlternatingRowStyle-CssClass="gridview_alternate"
                                    AutoGenerateColumns="false" RowStyle-CssClass="gridviewitem" PageSize="10" AllowPaging="true"
                                    PagerStyle-CssClass="pgr" EmptyDataRowStyle-CssClass="emptyrow" DataKeyNames="WHSID"
                                    OnSelectedIndexChanged="GrdLocation_SelectedIndexChanged" OnPageIndexChanging="GrdLocation_PageIndexChanging"
                                    OnRowCreated="GrdLocation_RowCreated">
                                    <Columns>
                                        <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="S.No." ItemStyle-Width="25px">
                                            <ItemTemplate><%#Container.DataItemIndex+1%></ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField HeaderText="Description" DataField="WHSLOCATION" ItemStyle-Width="20%" />
                                        <asp:BoundField HeaderText="Parent Location" DataField="parentlocation" ItemStyle-Width="20%" />
                                        <asp:BoundField HeaderText="City" DataField="WHSCITY" ItemStyle-Width="45%"  />
                                        <asp:BoundField HeaderText="Active" DataField="WHSACTIVE" ItemStyle-Width="10%" />
                                        <asp:CommandField HeaderText="Edit" SelectText="<img src='../../Menu/images/Edit_user.png' alt='Edit'>" ShowSelectButton="true" />
                                    </Columns>
                                    <PagerStyle HorizontalAlign="Right" />
                                </asp:GridView>
                            </div>
                        </div>
                    </asp:Panel>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </div>
    </form>
</body>
</html>
